package com.jred.jforum.dao.sqlmap;

import java.util.HashMap;
import java.util.Map;

import com.jred.jforum.beans.user.JUser;
import com.jred.jforum.beans.user.User;

public class UserDAOImpl extends BaseDAO implements UserDAO {

	public JUser getUser(String username, String password, boolean isfull) {
		return this.getUser(username, password);
	}

	public JUser getUser(String username, String password) {
		JUser user = new JUser();
		user.setName(username);
		user.setPassword(password);
		return (JUser)getSqlMapClientTemplate().queryForObject("GET_USER", user);
	}
	
	public JUser getUserByName(String username){
		JUser user = new JUser();
		user.setName(username);
		return (JUser)getSqlMapClientTemplate().queryForObject("GET_USER_BY_NAME", user);
	}
	
	public Integer getMsgCountsByName(String sender){
		return (Integer)getSqlMapClientTemplate().queryForObject("COUNT_MESSAGES_BYUSER", sender);
	}
	

}
